/**
 * Created by aber on 2017/5/15.
 * router file
 */
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import {HomeComponent} from "../pages/home/home.component";
import {AppSidenavComponent} from "../pages/app-sidenav/app-sidenav.component";
import {DummyTasksComponent} from "app/pages/dummy-tasks/dummy-tasks.component";
import {CategoryIds} from "../shared/Category";
import {PendingTasksComponent} from "../pages/pending-tasks/pending-tasks.component";
import {NavigationComponent} from "app/pages/navigation/navigation.component";
import {PendingTaskComponent} from "../pages/pending-task/pending-task.component";
import {ProgressingTasksComponent} from "../pages/progressing-tasks/progressing-tasks.component";
import {FinishTasksComponent} from "../pages/finish-tasks/finish-tasks.component";
import {ProgressingTaskComponent} from "../pages/progressing-task/progressing-task.component";
import {MailsComponent} from "../pages/mails/mails.component";


const routes: Routes = [
  {path: '', component: HomeComponent,pathMatch: 'full'},
  {
    path: 'functions',
    component: AppSidenavComponent ,
    children: [
      { path: '', component: DummyTasksComponent},
      { path: CategoryIds.mails, component: MailsComponent},
      { path: CategoryIds.pending, component: PendingTasksComponent},
      { path: CategoryIds.progressing, component: ProgressingTasksComponent},
      { path: CategoryIds.finish, component: FinishTasksComponent},
      { path: CategoryIds.travel, component: DummyTasksComponent},
      { path: CategoryIds.risk, component: DummyTasksComponent},
    ]
  },
  { path: 'navigation',component: NavigationComponent },
  { path: 'pending/:id', component: PendingTaskComponent },
  { path: 'progressing/:id', component: ProgressingTaskComponent }
];

@NgModule({
  imports: [
    RouterModule.forRoot(routes)
  ],
  exports: [RouterModule],
  providers:[] // if you have gurad services add it to providers
})
export class AppRoutingModule { }
